# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        博智科技  
# Name:         splinter_demo
# Description:
# Author:       yzl
# Date:         2019-03-05
#-------------------------------------------------------------------------------


import time

from splinter import Browser


def splinter(url):
    browser = Browser()
    # 加载url
    browser.visit(url)
    # 等待加载完成
    time.sleep(2)
    # 填充 用户名 密码
    browser.find_by_id('txtusername').fill('1001')
    browser.find_by_id('txtpassword').fill('1001')
    # click the button of login
    # browser.find_by_id('btnlogin').click()
    # time.sleep(8)
    # close the window of brower
    # browser.quit()


if __name__ == '__main__':
    websize3 = 'http://zzbozhi.net/demo/index.php?m=Login&a=login'
    splinter(websize3)
    pass


# from selenium import webdriver
#
# driver = webdriver.Chrome()
#
# driver.get("http://www.baidu.com")
#
# time.sleep(1)
#
# driver.quit()
